﻿using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;

//BaseThing Includes
using BaseThing.Definitions;
using BaseThing.Engine;

namespace BaseThing.Game
{
    class GameInputUser : GameInput
    { 
        //--- PUBLIC METHODS
        public GameInputUser() : base(InputType.INPUT_USER)
        {
        }

        public override void Update(ref PlayerStates l_ePlayerState)
        {

            if (Keyboard.GetState().Equals(new KeyboardState()))
            {
                //No keys are pressed.  
                l_ePlayerState = PlayerStates.PLAYER_IDLE;
            }

            if (Keyboard.GetState().IsKeyDown(Keys.Up))
            {
                l_ePlayerState = PlayerStates.PLAYER_MOVE_UP;
            }

            if (Keyboard.GetState().IsKeyDown(Keys.Down))
            {
                l_ePlayerState = PlayerStates.PLAYER_MOVE_DOWN;
            }

            if (Keyboard.GetState().IsKeyDown(Keys.Right))
            {
                l_ePlayerState = PlayerStates.PLAYER_MOVE_RIGHT;
            }

            if (Keyboard.GetState().IsKeyDown(Keys.Left))
            {
                l_ePlayerState = PlayerStates.PLAYER_MOVE_LEFT;
            }

            base.Update(ref l_ePlayerState);
        }

        //--- PRIVATE ATTRIBUTES
    }
}
